package com.coment.po.roles;

import com.coment.cfg.luban.constant.AIDCFG;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

/// 角色状态面板
@Setter
@Getter
public class StatusPanel {
    public Map<Integer, Double> status = new HashMap<>();

    public Map<Integer, Double> getValue() {
        Map<Integer, Double> map = new HashMap<>();
        if (this.status != null) {
            this.status.forEach((key, value) -> map.merge(key, value, Double::sum));
        }
        return map;
    }

    /// 重置攻击
    public void resetAttack() {
        status.put(AIDCFG.lastAtkTime1, 1D);
    }

    public void clear() {
        status.clear();
    }
}
